import express from "express"
import {
    createPutout, getAllPutouts,
    getFollowingPutouts, getLikedPutouts,
    getUserPutouts, likeUnlikePutout,
    commentOnPutout, deletePutout
} from "../controllers/putout.controller.js"
import { protectRoute } from "../middleware/protectRoute.js"


const router = express.Router()
router.get("/all", protectRoute, getAllPutouts)
router.get("/following", protectRoute, getFollowingPutouts)
router.get("/likes/:id", protectRoute, getLikedPutouts)
router.get("/user/:username", protectRoute, getUserPutouts)

router.post("/create", protectRoute, createPutout)
router.post("/like/:id", protectRoute, likeUnlikePutout)
router.post("/comment/:id", protectRoute, commentOnPutout)

router.delete("/:id", protectRoute, deletePutout)

export default router